package com.hdaccp.ch07

import org.apache.spark.sql.SparkSession

object Demo2 {

  def main(args: Array[String]): Unit = {
    //F:\accp教学\sparkresources\clean6

    val spark = SparkSession.builder()
      .master("local[2]")
      .appName("ch07Demo1App")
      .getOrCreate()

    import  spark.implicits._


   val df = spark.read.format("parquet").load("F:\\accp教学\\sparkresources\\clean6")

   df.createOrReplaceTempView("music")

    df.sqlContext.sql("select gender,count(1) from music group by gender").show()





    spark.stop()
  }

}
